<template>
  <div class="products-container">
    <div class="products-header">
      <h1>商品列表</h1>
      <el-input
        placeholder="搜索商品"
        v-model="searchQuery"
        class="search-input"
        clearable>
      </el-input>
    </div>
    
    <div class="products-grid">
      <div class="product-card" v-for="i in 8" :key="i">
        <div class="product-image"></div>
        <div class="product-info">
          <h3>小米手机 {{i}}</h3>
          <p class="description">高性能智能手机</p>
          <p class="price">¥1999</p>
          <el-button type="primary" size="small">加入购物车</el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Products',
  data() {
    return {
      searchQuery: ''
    }
  }
}
</script>

<style scoped>
.products-container {
  max-width: 1226px;
  margin: 0 auto;
  padding: 20px;
}

.products-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.products-header h1 {
  font-size: 24px;
  color: #333;
}

.search-input {
  width: 300px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.product-card {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-5px);
}

.product-image {
  height: 200px;
  background-color: #f5f5f5;
  border-radius: 4px 4px 0 0;
}

.product-info {
  padding: 15px;
}

.product-info h3 {
  font-size: 16px;
  color: #333;
  margin-bottom: 10px;
}

.description {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}

.price {
  color: #ff6700;
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
}
</style> 